package com.blockchain.console.servlets.trading.xlb;

import java.math.BigDecimal;
import java.sql.Timestamp;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.blockchain.common.enums.IsPass;
import com.blockchain.common.enums.ZrState;
import com.blockchain.console.service.trading.TradingManage;
import com.blockchain.console.service.trading.entity.XlbEntity;
import com.blockchain.console.service.trading.query.XlbQuery;
import com.blockchain.console.servlets.trading.AbstractTradingServlet;
import com.blockchain.framework.http.servlet.annotation.Right;
import com.blockchain.framework.http.upload.UploadFile;
import com.blockchain.framework.service.ServiceSession;
import com.blockchain.framework.service.query.Paging;
import com.blockchain.framework.service.query.PagingResult;
import com.blockchain.util.parser.IntegerParser;
import com.blockchain.util.parser.TimestampParser;

@Right(id = "C_TRADING_XLBLIST", isMenu = true, name = "虚拟币管理")
public class XlbList extends AbstractTradingServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void processGet(HttpServletRequest request, HttpServletResponse response, ServiceSession serviceSession)
			throws Throwable {
		processPost(request, response, serviceSession);
	}

	@Override
	protected void processPost(final HttpServletRequest request, final HttpServletResponse response,
			final ServiceSession serviceSession) throws Throwable {
		TradingManage tsradingManage = serviceSession.getService(TradingManage.class);
		PagingResult<XlbEntity> xlbs = tsradingManage.xlbSearch(new XlbQuery() {
			
			@Override
			public BigDecimal getZx_xz() {
				return null;
			}
			
			@Override
			public String getZwm() {
				return request.getParameter("zwm");
			}
			
			@Override
			public BigDecimal getZg_sxf() {
				return null;
			}
			
			@Override
			public BigDecimal getZd_xz() {
				return null;
			}
			
			@Override
			public BigDecimal getZd_sxf() {
				return null;
			}
			
			@Override
			public ZrState getZc_zr() {
				return null;
			}
			
			@Override
			public IsPass getZc_zc() {
				return null;
			}
			
			@Override
			public String getYwm() {
				return null;
			}
			
			@Override
			public String getYwjc() {
				return null;
			}
			
			@Override
			public UploadFile getTblj() {
				return null;
			}
			
			@Override
			public IsPass getSfzdzrlqb() {
				return null;
			}
			
			@Override
			public String getR_qbsy() {
				return null;
			}
			
			@Override
			public String getR_qbdz() {
				return null;
			}
			
			@Override
			public String getL_qbdz() {
				return null;
			}
			
			@Override
			public String getDy_zdzr() {
				return null;
			}
			
			@Override
			public Timestamp getCreateTimeStart() {
				return TimestampParser.parse(request.getParameter("start"));
			}

			@Override
			public Timestamp getCreateTimeEnd() {
				return TimestampParser.parse(request.getParameter("end"));
			}

			@Override
			public String getWalletIp() {
				return null;
			}

			@Override
			public String getWalletPort() {
				return null;
			}

			@Override
			public String getWalletUsername() {
				return null;
			}

			@Override
			public String getWalletPassword() {
				return null;
			}

			@Override
			public Timestamp getTcrq() {
				return null;
			}
			
			@Override
			public String getMethodId() {
				return null;
			}

			@Override
			public String getContractAddress() {
				return null;
			}

			@Override
			public String getUnit() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCoinType() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getTranHotWallet() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCoinNameTw() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCoinDesc() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCoinDescEn() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public String getCoinDescTw() {
				// TODO Auto-generated method stub
				return null;
			}
		}, new Paging() {

			@Override
			public int getSize() {
				return 10;
			}

			@Override
			public int getCurrentPage() {
				return IntegerParser.parse(request.getParameter(PAGING_CURRENT));
			}
		});
		request.setAttribute("xlbs", xlbs);
		forwardView(request, response, getClass());
	}

}
